package com.angel.mocks.factories;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang.RandomStringUtils;

import com.angel.mocks.io.CalendarTask;

public class CalendarTaskFactory {

	private CalendarTaskFactory(){
		super();
	}

	public static CalendarTask createCalendarTask(){
		CalendarTask calendarTask = new CalendarTask();
		calendarTask.setDescription(RandomStringUtils.randomAlphabetic(12));
		calendarTask.setModeratorName(RandomStringUtils.randomAlphabetic(12) + ", "+ RandomStringUtils.randomAlphabetic(12));
		calendarTask.setSubject(RandomStringUtils.randomAlphabetic(15));
		calendarTask.setBegin(new Date(Long.parseLong(RandomStringUtils.randomNumeric(12))));
		calendarTask.setEnd(new Date(Long.parseLong(RandomStringUtils.randomNumeric(8))));
		return calendarTask;
	}

	public static List<CalendarTask> createCalendarTask(int quantity){
		List<CalendarTask> entities = new ArrayList<CalendarTask>();
		for(int i = 0; i < quantity; i++){
			entities.add(createCalendarTask());
		}
		return entities;
	}
}
